<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script>
function ren(){
	this.name='zs';
	this.age=12;
	this.sex='man';	
};
ren.prototype={
	say:function(){
		alert('123')	
	}
}
//var ren1=new ren();
//ren1.say();

function stu(){
		
}
//继承方法：
//1. 通过原型=实例化的方式
stu.prototype=new ren();
var stu1=new stu();
alert(stu1.name)



//2.通过子类的原型=父类的原型
stu.prototype=ren.prototype;
var stu1=new stu();
stu1.say();













</script>
</body>
</html>
